<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="./template/layout.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	<ui:define name="conteudo">
		<div style="margin: 10px 10px 0 10px;">

			<h:form style="margin-left:10px; margin-right:20px; text-align:center;">
				<p:dataTable var="u" id="tabela" value="#{editoraBEAN.editoras}"
					binding="#{editoraBEAN.datatable}">
					<p:column>
						<f:facet name="header">
							<h:outputText value="ID" />
						</f:facet>
						<h:outputText value="#{u.id}" />
					</p:column>
					<p:column sortBy="#{u.nome}" filterBy="#{u.nome}">
						<f:facet name="header">
							<h:outputText value="Nome" />
						</f:facet>
						<h:outputText value="#{u.nome}" />
					</p:column>
					<p:column>
						<f:facet name="header">
							<h:outputText value="Ação" />
						</f:facet>
	    				<p:commandButton icon="ui-icon-wrench" action="#{editoraBEAN.editarEditora()}" ajax="false"/>
	    				<p:commandButton icon="ui-icon-trash" action="#{editoraBEAN.deletarEditora()}" ajax="false"/>
					</p:column>
				</p:dataTable>
				<h:panelGrid>
				<p:panel header="Emitir Relatório">
				<h:commandLink>  
	        	    <p:graphicImage value="/images/excel.png" />  
	            	<p:dataExporter type="xls" target="tabela" fileName="emprestimosResevados" />  
	  		    </h:commandLink>  
	  	        <h:commandLink>  
	  	    	    <p:graphicImage value="/images/pdf.png" />  
	    	        <p:dataExporter type="pdf" target="tabela" fileName="emprestimosResevados" />  
	        	</h:commandLink>
	        	</p:panel>
	        	</h:panelGrid>
			</h:form>
		</div>
	</ui:define>
</ui:composition>
